package org.dolphin.util;

public class ExceptionHelper {
  public static Throwable getRootCause(Throwable e) {
    Throwable ex = e;
    if (ex == null) {
      return null;
    }
    Throwable cause = e.getCause();
    while (cause != null) {
      ex = cause;
      cause = ex.getCause();
    }
    return ex;
  }
}
